<?php

namespace app\models\jasper;

trait JasperApiGlobalSimTransferTrait
{
    /**
     * @param string $primaryIccid
     * @param string $targetPartnerName
     * @param string $globalAlianceName
     * @param string $globalSimTransferType
     * @param string $callbackNotificationURL
     * @return \stdClass
     * @throws \Exception
     */
    public function TransferGlobalSim($primaryIccid, $targetPartnerName, $globalAlianceName, $globalSimTransferType, $callbackNotificationURL)
    {
        return $this->call(
            preg_replace('/.*JasperApi(.*?)Trait/', '$1', __TRAIT__),
            __FUNCTION__,
            [
                'primaryIccid' => $primaryIccid,
                'targetPartnerName' => $targetPartnerName,
                'globalAlianceName' => $globalAlianceName,
                'globalSimTransferType' => $globalSimTransferType,
                'callbackNotificationURL' => $callbackNotificationURL,
            ]
        );
    }

    /**
     * @param string $primaryIccid
     * @return \stdClass
     * @throws \Exception
     */
    public function GetGlobalSimTransferStatus($primaryIccid)
    {
        return $this->call(
            preg_replace('/.*JasperApi(.*?)Trait/', '$1', __TRAIT__),
            __FUNCTION__,
            [
                'primaryIccid' => $primaryIccid,
            ]
        );
    }

    /**
     * @param string $primaryIccid
     * @return \stdClass
     * @throws \Exception
     */
    public function CancelGlobalSimTransfer($primaryIccid)
    {
        return $this->call(
            preg_replace('/.*JasperApi(.*?)Trait/', '$1', __TRAIT__),
            __FUNCTION__,
            [
                'primaryIccid' => $primaryIccid,
            ]
        );
    }
}
